#pragma once

#include "tcservercore_global.h"

#include <Type/Permission.h>

namespace TCServer
{
    namespace Manager
    {
        class TCSERVERCORE_EXPORT SignatureManager
        {
        private:
            static const QByteArray key;
        private:
            SignatureManager();
            ~SignatureManager();
        public:
            QByteArray generateFromUserPermissions(quint64 userId, const QSet<Type::Permission> &permissions);
            std::tuple<bool,
                quint64, 
                QSet<Type::Permission>> 
                check(const QByteArray &signature);
        public:
            static SignatureManager* instance();
        private:
            static SignatureManager* _instance;
        };
    }
}